<template>
<uni-shadow-root class="partials-banner-firstBanner"><template name="firstBanner">
 
  <block v-if="jsonData.height < 3">
   
    <view class="SwiperContainer" :style="'width:'+(jsonData.width?jsonData.width+"rpx":"100%")+';height:'+(jsonData.height<10?jsonData.height * sysWidth+"px":jsonData.height+"rpx")+';'">
      <swiper class="SwiperIndex" indicator-dots="true" :autoplay="autoplay||''" interval="5000" duration="1000" :indicator-color="platformSetting.secondColor" :indicator-active-color="platformSetting.defaultColor" @change="changeSwiperFun">
        <block v-for="(item,index) in (imgData)" :key="item.index">
          <swiper-item>
            <block v-if="(!item.type||item.type=='img')">
                <image mode="aspectFit" :src="item.imageUrl||item.imagePath||item" :data-link="item.linkUrl||item.imagePath||item" @click="tolinkUrl"></image>
                <view class="sold_out_block" v-if="jsonData.stock<=0">售罄</view>
            </block>
            <component-tag-video :id="'videoComponent_'+(index)" v-if="item.type=='video'||item.type=='video_other'" :data="item.jsonData" @sendDataFun="getDataFun"></component-tag-video>
            
          </swiper-item>
        </block>
      </swiper>
    </view>
  </block>
  <block v-else>
      <view :class="'SwiperContainer '+(jsonData.styleType=="product"?"blcok":"")" :style="'width:'+(jsonData.width?jsonData.width+"rpx":"100%")+';height:'+(jsonData.height<10?jsonData.height * sysWidth+"px":jsonData.height+"rpx")+';'">
        <swiper class="SwiperIndex" indicator-dots="true" :autoplay="autoplay||''" interval="5000" duration="1000" :indicator-color="platformSetting.secondColor" :indicator-active-color="platformSetting.defaultColor" @change="changeSwiperFun">
          <block v-for="(item,index) in (imgData)" :key="item.index">
            <swiper-item>
                <block v-if="(!item.type||item.type=='img')">
                    <image :class="jsonData.styleType=="product"?"productImg":""" mode="aspectFit" v-if="(!item.type||item.type=='img')" :src="(item.imageUrl||item.imagePath||item)+'?x-oss-process=style/normal'" :data-link="item.linkUrl||item.imagePath||item" @click="tolinkUrl"></image>
                    <view class="sold_out_block" v-if="jsonData.stock<=0">售罄</view>
                </block>
              
              <component-tag-video :id="'videoComponent_'+(index)" v-if="item.type=='video'||item.type=='video_other'" :data="item.jsonData" @sendDataFun="getDataFun"></component-tag-video>
              
            </swiper-item>
          </block>
        </swiper>
      </view>
    
  </block>

</template></uni-shadow-root>
</template>

<script>

global['__wxRoute'] = 'partials/banner/firstBanner'

Component({})

export default global['__wxComponents']['partials/banner/firstBanner']
</script>
<style platform="mp-weixin">

</style>